package com.my.serviceimpl;

import com.my.bean.Kitchenhy;
import com.my.bean.ResultPage;
import com.my.bean.VoPage;
import com.my.mapper.KitchenhyMapper;
import com.my.service.KitchenhyService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 厨房卫生状况 服务实现类
 * </p>
 *
 * @author 闫亚茹
 * @since 2018-09-10
 */
@Service
public class KitchenhyServiceImpl extends ServiceImpl<KitchenhyMapper, Kitchenhy> implements KitchenhyService {

    public ResultPage<Kitchenhy> selectMyPage(Map map, VoPage voPage,Long areaid,boolean admin) {
        Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("page", (voPage.getPage() - 1) * voPage.getLimit());
        paramMap.put("limit", voPage.getLimit());
        List<Kitchenhy> list = baseMapper.selectKitchenhy(map, paramMap,areaid,admin);
        Integer count = baseMapper.countMyPage(map, paramMap,areaid,admin);
        ResultPage<Kitchenhy> resultPage = new ResultPage<>();
        resultPage.setCode(0);
        resultPage.setCount(count);
        resultPage.setMsg("成功");
        resultPage.setData(list);
        return resultPage;
    }

    @Override
    public List<Kitchenhy> selectKitchenhy() {
        return null;
    }

}
